<?php

namespace app\api\controller;

use app\api\logic\user\UserLogin as UserLoginLogic;
use app\api\logic\user\UserProfile as UserProfileLogic;
use app\api\logic\user\UserAuth as UserAuthLogic;
use app\api\logic\user\UserArticle as UserArticleLogic;
use app\api\logic\user\UserBook as UserBookLogic;

class User
{
    use \app\common\traits\Controller;

    public function __construct(
        UserLoginLogic $userLoginLogic,
        UserProfileLogic $userProfileLogic,
        UserAuthLogic $userAuthLogic,
        UserArticleLogic $userArticleLogic,
        UserBookLogic $userBookLogic
    )
    {
        $this->userLoginLogic = $userLoginLogic;
        $this->userProfileLogic = $userProfileLogic;
        $this->userAuthLogic = $userAuthLogic;
        $this->userArticleLogic = $userArticleLogic;
        $this->userBookLogic = $userBookLogic;
    }

    public function register()
    {
        return self::httpResp($this->userLoginLogic->register());
    }

    public function login()
    {
        return self::httpResp($this->userLoginLogic->login());
    }

    public function profile()
    {
        return self::httpResp($this->userProfileLogic->profile());
    }

    public function update()
    {
        return self::httpResp($this->userProfileLogic->update());
    }

    public function checkAuth()
    {
        return self::httpResp($this->userAuthLogic->check());
    }

    public function createArticle()
    {
        return self::httpResp($this->userArticleLogic->create());
    }

    public function getArticle()
    {
        return self::httpResp($this->userArticleLogic->get());
    }

    public function updateArticle()
    {
        return self::httpResp($this->userArticleLogic->update());
    }

    public function deleteArticle()
    {
        return self::httpResp($this->userArticleLogic->delete());
    }

    public function getArticles()
    {
        return self::httpResp($this->userArticleLogic->getArticles());
    }

    public function createArticleComment()
    {
        return self::httpResp($this->userArticleLogic->createArticleComment());
    }

    public function doPraise()
    {
        return self::httpResp($this->userArticleLogic->doPraise());
    }

    public function getOwnTags()
    {
        return self::httpResp($this->userBookLogic->getOwnTags());
    }

    public function getBook()
    {
        return self::httpResp($this->userBookLogic->get());
    }

    public function getBooks()
    {
        return self::httpResp($this->userBookLogic->getBooks());
    }

    public function getOwnBooks()
    {
        return self::httpResp($this->userBookLogic->getOwnBooks());
    }

    public function createBook()
    {
        return self::httpResp($this->userBookLogic->create());
    }

    public function updateBook()
    {
        return self::httpResp($this->userBookLogic->update());
    }

    public function deleteBook()
    {
        return self::httpResp($this->userBookLogic->delete());
    }
}
